home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / misc / emu / FrodoV1_5.lha / src / Main.asm < prev    next >
Assembly Source File  |  1995-06-04  |  37KB  |  1,784 lines

  1. *
  2. * Main.asm - Hauptprogramm des C64-Emulators/Einstellungsfenster
  3. *
  4. * Copyright (C) 1994-1995 by Christian Bauer
  5. *
  6.  
  7.         MACHINE    68020
  8.  
  9.         INCLUDE    "exec/types.i"
  10.         INCLUDE    "exec/macros.i"
  11.         INCLUDE    "exec/memory.i"
  12.         INCLUDE    "exec/execbase.i"
  13.         INCLUDE    "dos/dos.i"
  14.         INCLUDE    "dos/dosextens.i"
  15.         INCLUDE    "intuition/intuition.i"
  16.         INCLUDE    "intuition/intuitionbase.i"
  17.         INCLUDE    "graphics/displayinfo.i"
  18.         INCLUDE    "libraries/gadtools.i"
  19.         INCLUDE    "libraries/asl.i"
  20.         INCLUDE    "libraries/locale.i"
  21.         INCLUDE    "cybergraphics/cybergraphics.i"
  22.         INCLUDE    "workbench/workbench.i"
  23.         INCLUDE    "workbench/startup.i"
  24.         INCLUDE    "FrodoPrefs.i"
  25.         INCLUDE    "Frodo_rev.i"
  26. CATCOMP_NUMBERS    = 1
  27.         INCLUDE    "Strings.i"
  28.  
  29.         XREF    _SysBase    ;AStartup
  30.         XREF    _DOSBase
  31.         XREF    _WBenchMsg
  32.         XDEF    _main
  33.  
  34.         XDEF    _UtilityBase
  35.         XDEF    _IntuitionBase
  36.         XDEF    _GfxBase
  37.         XDEF    _GadToolsBase
  38.         XDEF    _AslBase
  39.         XDEF    _EGSBase
  40.         XDEF    _VilIntuiBase
  41.         XDEF    _CyberGfxBase
  42.         XDEF    _HRGSystemBase
  43.         XDEF    _CiaBase
  44.         XDEF    _MiscBase
  45.         XDEF    _SID6581Base
  46.  
  47.         XDEF    MainTask
  48.         XDEF    ShowPrefs
  49.         XDEF    Random
  50.  
  51.         XREF    PrefsNGads
  52.  
  53.         XDEF    TheLocale    ;Strings.o
  54.         XREF    GetString
  55.  
  56.         XREF    TheRAM        ;6510.asm
  57.         XREF    TheBasic
  58.         XREF    TheKernal
  59.         XREF    TheChar
  60.         XREF    TheColor
  61.         XREF    Init6510
  62.         XREF    Start6510
  63.         XREF    Stop6510
  64.         XREF    Wait6510
  65.         XREF    Pause6510
  66.         XREF    Resume6510
  67.         XREF    Localize6510
  68.  
  69.         XREF    Reset6526    ;6526.asm
  70.         XREF    ChangedKeys
  71.         XREF    CIACycles
  72.         XREF    Joystick1On
  73.         XREF    Joystick2On
  74.         XREF    JoystickSwap
  75.         XREF    KeyboardYZ
  76.  
  77.         XREF    OpenGraphics    ;6569.asm
  78.         XREF    CloseGraphics
  79.         XREF    WaitForClick
  80.         XREF    AmigaToFront
  81.         XREF    EmulToFront
  82.         XREF    DisplayID
  83.         XREF    ScreenType
  84.         XREF    NormalCycles
  85.         XREF    BadLineCycles
  86.         XREF    Collisions
  87.         XREF    Overscan
  88.         XREF    SkipLatch
  89.         XDEF    TurboCyber
  90.  
  91.         XREF    Reset6581    ;6581.asm
  92.         XREF    ChangedSID
  93.         XREF    PauseSound
  94.         XREF    ResumeSound
  95.         XREF    CloseSID
  96.         XREF    UseSIDCard
  97.  
  98.         XREF    Open1541    ;1541.asm
  99.         XREF    Close1541
  100.         XREF    ChangedDirs
  101.         XREF    CloseIEC
  102.         XREF    ChangedIEC
  103.         XREF    Dir8
  104.         XREF    Dir9
  105.         XREF    Dir10
  106.         XREF    Dir11
  107.         XREF    Drv8IsIEC
  108.         XREF    Drv9IsIEC
  109.         XREF    Drv10IsIEC
  110.         XREF    Drv11IsIEC
  111.         XREF    OtherIEC
  112.         XREF    MapSlash
  113.  
  114.         SECTION    "CODE",CODE
  115.  
  116.  
  117. **
  118. ** Definitionen
  119. **
  120.  
  121. ; CyberGfx
  122. CModeRequest    = -66
  123.  
  124.  
  125. **
  126. ** Makros
  127. **
  128.  
  129. ; LongInt-Wert aus Integer-Gadget a0 lesen
  130. GetInt        MACRO    ;Ziel
  131.         move.l    gg_SpecialInfo(a0),a0
  132.         move.l    si_LongInt(a0),\1
  133.         ENDM
  134.  
  135.  
  136. **
  137. ** Hauptprogramm
  138. **
  139.  
  140.         MACHINE    68000
  141.  
  142. ; Task holen
  143. _main        move.l    _SysBase,a6
  144.         sub.l    a1,a1
  145.         JSRLIB    FindTask
  146.         move.l    d0,MainTask
  147.  
  148. ; Libraries öffnen
  149.         moveq    #37,d0
  150.         lea    UtilityName,a1
  151.         JSRLIB    OpenLibrary
  152.         move.l    d0,_UtilityBase
  153.         beq    NoUtility
  154.  
  155.         moveq    #37,d0
  156.         lea    IntuiName,a1
  157.         JSRLIB    OpenLibrary
  158.         move.l    d0,_IntuitionBase
  159.         beq    NoIntui
  160.  
  161.         moveq    #37,d0
  162.         lea    GfxName,a1
  163.         JSRLIB    OpenLibrary
  164.         move.l    d0,_GfxBase
  165.         beq    NoGfx
  166.  
  167.         moveq    #37,d0
  168.         lea    GadToolsName,a1
  169.         JSRLIB    OpenLibrary
  170.         move.l    d0,_GadToolsBase
  171.         beq    NoGadTools
  172.  
  173.         moveq    #38,d0
  174.         lea    AslName,a1
  175.         JSRLIB    OpenLibrary
  176.         move.l    d0,_AslBase
  177.         beq    NoAsl
  178.  
  179.         moveq    #37,d0
  180.         lea    IconName,a1
  181.         JSRLIB    OpenLibrary
  182.         move.l    d0,_IconBase
  183.         beq    NoIcon
  184.  
  185.         moveq    #0,d0
  186.         lea    SID6581Name,a1
  187.         JSRLIB    OpenLibrary
  188.         move.l    d0,_SID6581Base
  189.  
  190.         lea    CiaResName,a1
  191.         JSRLIB    OpenResource
  192.         move.l    d0,_CiaBase
  193.         beq    NoCiaRes
  194.  
  195.         lea    MiscResName,a1
  196.         JSRLIB    OpenResource
  197.         move.l    d0,_MiscBase
  198.         beq    NoMiscRes
  199.  
  200. ; Locale öffnen und Catalog laden
  201.         move.l    _SysBase,a6
  202.         moveq    #37,d0
  203.         lea    LocaleName,a1
  204.         JSRLIB    OpenLibrary
  205.         move.l    d0,_LocaleBase
  206.         beq    10$
  207.         move.l    d0,a6
  208.         sub.l    a0,a0
  209.         lea    CatalogName,a1
  210.         sub.l    a2,a2
  211.         JSRLIB    OpenCatalogA
  212.         move.l    d0,TheCatalog
  213.  
  214. ; Datenstrukturen lokalisieren
  215. 10$        bsr    Localize
  216.         bsr    Localize6510
  217.  
  218. ; 68020 vorhanden?
  219.         move.l    _SysBase,a0
  220.         move.w    AttnFlags(a0),d0
  221.         btst    #AFB_68020,d0
  222.         beq    No68020Exit
  223.  
  224.         MACHINE    68020
  225.  
  226. ; Argumente auswerten: Vom CLI gestartet?
  227.         move.l    MainTask,a0
  228.         tst.l    pr_CLI(a0)
  229.         beq    1$
  230.  
  231. ; Ja, ReadArgs benutzen
  232.         move.l    _DOSBase,a6
  233.         move.l    #Template,d1
  234.         move.l    #TurboCyber,d2    ;Erstes Argument
  235.         moveq    #0,d3
  236.         JSRLIB    ReadArgs
  237.         move.l    d0,d1        ;NULL ist OK
  238.         JSRLIB    FreeArgs
  239.         bra    2$
  240.  
  241. ; Von der Workbench gestartet, ToolTypes lesen
  242. 1$        move.l    _IconBase,a6
  243.  
  244.         move.l    _WBenchMsg,a0
  245.         move.l    sm_ArgList(a0),a0
  246.         move.l    wa_Name(a0),a0
  247.         JSRLIB    GetDiskObject
  248.         tst.l    d0
  249.         beq    2$
  250.         move.l    d0,a2
  251.  
  252.         move.l    a2,a0
  253.         move.l    do_ToolTypes(a0),a0
  254.         lea    TurboToolType,a1
  255.         JSRLIB    FindToolType
  256.         tst.l    d0
  257.         beq    3$
  258.         move.l    #-1,TurboCyber
  259.  
  260. 3$        move.l    a2,a0
  261.         JSRLIB    FreeDiskObject
  262. 2$
  263.  
  264. ; ScreenMode- und Directory-Requester holen
  265.         move.l    _AslBase,a6
  266.         moveq    #ASL_ScreenModeRequest,d0
  267.         lea    ScreenReqTags,a0
  268.         JSRLIB    AllocAslRequest
  269.         move.l    d0,ScreenRequester
  270.         beq    NoMemExit
  271.  
  272.         moveq    #ASL_FileRequest,d0
  273.         lea    DirReqTags,a0
  274.         JSRLIB    AllocAslRequest
  275.         move.l    d0,DirRequester
  276.         beq    NoMemExit
  277.  
  278. ; Zufallszahlengenerator initialisieren
  279.         move.l    _IntuitionBase,a0
  280.         move.l    ib_Micros(a0),RandomSeed
  281.  
  282. ; Vorgegebene Einstellungen
  283.         move.w    #63,PNormalCycles
  284.         move.w    #23,PBadLineCycles
  285.         move.w    #63,PCIACycles
  286.         clr.w    PJoystick1On
  287.         move.w    #-1,PJoystick2On
  288.         clr.w    PJoystickSwap
  289.         clr.l    PDisplayID
  290.         clr.w    PScreenType
  291.         clr.b    PDir8
  292.         clr.b    PDir9
  293.         clr.b    PDir10
  294.         clr.b    PDir11
  295.         clr.w    PUseSIDCard
  296.         clr.w    KeyboardYZ
  297.         move.w    #-1,PCollisions
  298.         move.w    #-1,PMapSlash
  299.         move.w    #-1,PFastReset
  300.         move.w    #OSCAN_TEXT,POverscan
  301.         move.w    #1,PSkipLatch
  302.  
  303. ; Einstellungen laden
  304.         move.l    _DOSBase,a6
  305.         move.l    #PrefsFileName,d1
  306.         move.l    #MODE_OLDFILE,d2
  307.         JSRLIB    Open
  308.         move.l    d0,d7
  309.         beq    NoEmulPrefs
  310.  
  311.         move.l    d7,d1
  312.         move.l    #ThePrefs,d2
  313.         move.l    #PrefsLength,d3
  314.         JSRLIB    Read
  315.  
  316.         move.l    d7,d1
  317.         JSRLIB    Close
  318. NoEmulPrefs
  319.  
  320. ; Einstellungsfenster darstellen
  321.         clr.w    PrefsFromEmul
  322.         bsr    DoThePrefs
  323.  
  324. ; Einstellungen übernehmen, wenn OK geklickt, sonst beenden
  325.         tst.l    d7
  326.         beq    Exit
  327.         bsr    SetPrefs
  328.  
  329. ; Dateikram vorbereiten
  330.         jsr    Open1541
  331.         jsr    ChangedIEC
  332.         bsr    IECErrorReq
  333.  
  334. ; Speicher für alles holen (die unteren Worte müssen mit den C64-Adressen
  335. ; übereinstimmen, außer CharROM)
  336.         move.l    _SysBase,a6
  337.         move.l    #$30000,d0        ;192K
  338.         move.l    #MEMF_ANY|MEMF_CLEAR,d1
  339.         JSRLIB    AllocVec
  340.         move.l    d0,RAMBlock
  341.         beq    NoMemExit
  342.  
  343.         add.l    #$ffff,d0        ;Auf xxxx0000 bringen
  344.         clr.w    d0
  345.         move.l    d0,TheRAM
  346.         add.l    #$11000,d0
  347.         move.l    d0,TheChar        ;yyyy1000
  348.         add.l    #$9000,d0
  349.         move.l    d0,TheBasic        ;yyyya000
  350.         add.l    #$3800,d0
  351.         move.l    d0,TheColor        ;yyyyd800
  352.         add.l    #$0800,d0
  353.         move.l    d0,TheKernal        ;yyyye000
  354.  
  355. ; Opcodes $d2 (Wraparound) ab $10000 installieren,
  356. ; für den Fall, daß ein Programm über $ffff springt
  357.         move.l    TheRAM,a0
  358.         lea    $10000(a0),a0
  359.         moveq    #256/4-1,d0
  360. 1$        move.l    #$d2d2d2d2,(a0)+
  361.         dbra    d0,1$
  362.  
  363. ; ROMs laden
  364.         move.l    _DOSBase,a6
  365.         move.l    #BasicFileName,d1    ;Basic
  366.         move.l    #MODE_OLDFILE,d2
  367.         JSRLIB    Open
  368.         move.l    d0,d7
  369.         beq    NoBasicExit
  370.         move.l    d0,d1
  371.         move.l    TheBasic,d2
  372.         move.l    #$2000,d3
  373.         JSRLIB    Read
  374.         move.l    d7,d1
  375.         JSRLIB    Close
  376.  
  377.         move.l    #KernalFileName,d1    ;Kernal
  378.         move.l    #MODE_OLDFILE,d2
  379.         JSRLIB    Open
  380.         move.l    d0,d7
  381.         beq    NoKernalExit
  382.         move.l    d0,d1
  383.         move.l    TheKernal,d2
  384.         move.l    #$2000,d3
  385.         JSRLIB    Read
  386.         move.l    d7,d1
  387.         JSRLIB    Close
  388.  
  389.         move.l    #CharFileName,d1    ;Char
  390.         move.l    #MODE_OLDFILE,d2
  391.         JSRLIB    Open
  392.         move.l    d0,d7
  393.         beq    NoCharExit
  394.         move.l    d0,d1
  395.         move.l    TheChar,d2
  396.         move.l    #$1000,d3
  397.         JSRLIB    Read
  398.         move.l    d7,d1
  399.         JSRLIB    Close
  400.  
  401. ; Betriebssystem patchen
  402.         move.l    TheKernal,a0
  403.         move.w    #$f200,$0d40(a0)    ;IECOut
  404.         move.w    #$f201,$0d23(a0)    ;IECOutATN
  405.         move.w    #$f202,$0d36(a0)    ;IECOutSec
  406.         move.w    #$f203,$0e13(a0)    ;IECIn
  407.         move.w    #$f204,$0def(a0)    ;IECSetATN
  408.         move.w    #$f205,$0dbe(a0)    ;IECRelATN
  409.         move.w    #$f206,$0dcc(a0)    ;IECTurnaround
  410.         move.w    #$f207,$0e03(a0)    ;IECRelease
  411.         bsr    PatchReset
  412.  
  413. ; Bildschirm öffnen
  414.         jsr    OpenGraphics
  415.         cmp.l    #1,d0
  416.         beq    NoScreenExit
  417.         cmp.l    #2,d0
  418.         beq    NoMemExit
  419.         cmp.l    #3,d0
  420.         beq    NoEGSExit
  421.         cmp.l    #4,d0
  422.         beq    NoVilIntuiExit
  423.         cmp.l    #5,d0
  424.         beq    NoDisplayIDExit
  425.         cmp.l    #6,d0
  426.         beq    ScrTooSmallExit
  427.         cmp.l    #7,d0
  428.         beq    NoCyberGfxExit
  429.         cmp.l    #8,d0
  430.         beq    NoCyberModeExit
  431.         cmp.l    #9,d0
  432.         beq    NoHRGExit
  433.  
  434. ; Alles initialisieren
  435.         jsr    Reset6526
  436.         jsr    Reset6581
  437.         jsr    Init6510
  438.  
  439. ; 6510 starten
  440.         jsr    Start6510
  441.         tst.l    d0
  442.         bne    NoMemExit
  443.  
  444. ; Auf Mausklick warten
  445.         jsr    WaitForClick
  446.  
  447. ; Programm beenden
  448.         bra    Exit
  449.  
  450. *
  451. * Fehlerbehandlung/Beenden
  452. *
  453.  
  454.         MACHINE    68000
  455.  
  456. No68020Exit    moveq    #MSG_NO68020,d0
  457.         lea    TheLocale,a0
  458.         jsr    GetString
  459.         lea    ErrorReq,a1
  460.         move.l    d0,es_TextFormat(a1)
  461.         sub.l    a0,a0
  462.         sub.l    a2,a2
  463.         sub.l    a3,a3
  464.         move.l    _IntuitionBase,a6
  465.         JSRLIB    EasyRequestArgs
  466.         bra    NoCiaRes
  467.  
  468.         MACHINE    68020
  469.  
  470. NoMemExit    moveq    #MSG_NOMEM,d0
  471.         bra    ReqExit
  472.  
  473. NoScreenExit    moveq    #MSG_NOSCREEN,d0
  474.         bra    ReqExit
  475.  
  476. NoEGSExit    moveq    #MSG_NOEGS,d0
  477.         bra    ReqExit
  478.  
  479. NoVilIntuiExit    moveq    #MSG_NOVILINTUI,d0
  480.         bra    ReqExit
  481.  
  482. NoCyberGfxExit    moveq    #MSG_NOCYBERGFX,d0
  483.         bra    ReqExit
  484.  
  485. NoHRGExit    moveq    #MSG_NOHRG,d0
  486.         bra    ReqExit
  487.  
  488. NoDisplayIDExit    moveq    #MSG_NODISPLAYID,d0
  489.         bra    ReqExit
  490.  
  491. NoCyberModeExit    moveq    #MSG_NOCYBERMODE,d0
  492.         bra    ReqExit
  493.  
  494. ScrTooSmallExit    moveq    #MSG_SCRTOOSMALL,d0
  495.         bra    ReqExit
  496.  
  497. NoKernalExit    moveq    #MSG_NOKERNAL,d0
  498.         bra    ReqExit
  499.  
  500. NoBasicExit    moveq    #MSG_NOBASIC,d0
  501.         bra    ReqExit
  502.  
  503. NoCharExit    moveq    #MSG_NOCHAR,d0
  504.  
  505. ReqExit        lea    TheLocale,a0
  506.         jsr    GetString
  507.         lea    ErrorReq,a1
  508.         move.l    d0,es_TextFormat(a1)
  509.         sub.l    a0,a0
  510.         sub.l    a2,a2
  511.         sub.l    a3,a3
  512.         move.l    _IntuitionBase,a6
  513.         JSRLIB    EasyRequestArgs
  514.  
  515. Exit        jsr    Stop6510
  516.         jsr    Reset6581    ;Stoppt diesen Lärm!
  517.         jsr    CloseSID
  518.         jsr    CloseGraphics
  519.         jsr    CloseIEC
  520.         jsr    Close1541
  521.  
  522.         move.l    _SysBase,a6
  523.  
  524.         move.l    RAMBlock,d0
  525.         beq    1$
  526.         move.l    d0,a1
  527.         JSRLIB    FreeVec
  528.  
  529. 1$        move.l    DirRequester,d0
  530.         beq    2$
  531.         move.l    _AslBase,a6
  532.         move.l    d0,a0
  533.         JSRLIB    FreeAslRequest
  534.  
  535. 2$        move.l    ScreenRequester,d0
  536.         beq    3$
  537.         move.l    _AslBase,a6
  538.         move.l    d0,a0
  539.         JSRLIB    FreeAslRequest
  540.  
  541. 3$
  542.         MACHINE    68000
  543.  
  544. NoMiscRes
  545. NoCiaRes    move.l    _SysBase,a6
  546.         move.l    _SID6581Base,d0
  547.         beq    NoSID6581
  548.         move.l    d0,a1
  549.         JSRLIB    CloseLibrary
  550.  
  551. NoSID6581    move.l    _CyberGfxBase,d0
  552.         beq    NoCyberGfx
  553.         move.l    d0,a1
  554.         JSRLIB    CloseLibrary
  555.  
  556. NoCyberGfx    move.l    _HRGSystemBase,d0
  557.         beq    NoHRG
  558.         move.l    d0,a1
  559.         JSRLIB    CloseLibrary
  560.  
  561. NoHRG        move.l    _VilIntuiBase,d0
  562.         beq    NoVilIntui
  563.         move.l    d0,a1
  564.         JSRLIB    CloseLibrary
  565.  
  566. NoVilIntui    move.l    _EGSBase,d0
  567.         beq    NoEGS
  568.         move.l    d0,a1
  569.         JSRLIB    CloseLibrary
  570.  
  571. NoEGS        move.l    _LocaleBase,d0        ;Catalog schließen
  572.         beq    NoLocale
  573.         move.l    d0,a6
  574.         move.l    TheCatalog,a0
  575.         JSRLIB    CloseCatalog
  576.         move.l    a6,a1
  577.         move.l    _SysBase,a6
  578.         JSRLIB    CloseLibrary
  579.  
  580. NoLocale    move.l    _IconBase,a1
  581.         JSRLIB    CloseLibrary
  582.  
  583. NoIcon        move.l    _AslBase,a1
  584.         JSRLIB    CloseLibrary
  585.  
  586. NoAsl        move.l    _GadToolsBase,a1
  587.         JSRLIB    CloseLibrary
  588.  
  589. NoGadTools    move.l    _GfxBase,a1
  590.         JSRLIB    CloseLibrary
  591.  
  592. NoGfx        move.l    _IntuitionBase,a1
  593.         JSRLIB    CloseLibrary
  594.  
  595. NoIntui        move.l    _UtilityBase,a1
  596.         JSRLIB    CloseLibrary
  597.  
  598. NoUtility    moveq    #0,d0
  599.         rts
  600.  
  601.         MACHINE    68020
  602.  
  603.  
  604. **
  605. ** Je nach Zustand von FastReset den Speichertest aus dem ROM entfernen
  606. **
  607.  
  608. PatchReset    move.l    TheKernal(pc),a0
  609.         tst.w    FastReset
  610.         bne    1$
  611.         move.w    #$d0e8,$1d84(a0)
  612.         rts
  613. 1$        move.w    #$a000,$1d84(a0)
  614.         rts
  615.  
  616.  
  617. **
  618. ** Preferences
  619. **
  620.  
  621. *
  622. * Preferences aus dem Emulator heraus
  623. *
  624.  
  625. ; C64 anhalten und nach hinten legen
  626. ShowPrefs    jsr    Pause6510
  627.         jsr    PauseSound
  628.         jsr    AmigaToFront
  629.  
  630. ; Aktuelle Preferences holen
  631.         bsr    GetPrefs
  632.  
  633. ; Fenster öffnen und handhaben
  634.         move.w    #-1,PrefsFromEmul
  635.         bsr    DoThePrefs
  636.  
  637. ; Prefs setzen, wenn OK geklickt
  638.         tst.l    d7
  639.         beq    1$
  640.         bsr    SetPrefs
  641.         jsr    ChangedDirs    ;Die stehen hier (und nicht in SetPrefs),
  642.         jsr    ChangedIEC    ; weil beim ersten Aufruf von SetPrefs
  643.         bsr    IECErrorReq    ; noch nicht alles initialisiert ist
  644.         bsr    PatchReset
  645. 1$
  646.  
  647. ; C64 nach vorn holen und wieder starten
  648.         jsr    EmulToFront
  649.         jsr    ResumeSound
  650.         jsr    Resume6510
  651.         rts
  652.  
  653. *
  654. * Handhabung des Preferences-Fensters
  655. *
  656.  
  657. ; Fenster öffnen
  658. DoThePrefs    jsr    SetupScreen
  659.         tst.l    d0
  660.         bne    PrefsError
  661.         jsr    OpenPrefsWindow
  662.         tst.l    d0
  663.         bne    PrefsError
  664.         bsr    SetGadgets
  665.         move.l    PrefsWnd,ScreenReqWindow
  666.         move.l    PrefsWnd,DirReqWindow
  667.  
  668. ; EventLoop
  669. EventLoop    move.l    _SysBase,a6
  670.         move.l    PrefsWnd,a0
  671.         move.l    wd_UserPort(a0),a0
  672.         JSRLIB    WaitPort
  673.  
  674. GetEvent    move.l    _GadToolsBase,a6
  675.         move.l    PrefsWnd,a0
  676.         move.l    wd_UserPort(a0),a0
  677.         JSRLIB    GT_GetIMsg
  678.         tst.l    d0
  679.         beq    EventLoop
  680.  
  681.         move.l    d0,a1
  682.         move.l    im_Class(a1),TheClass
  683.         move.w    im_Code(a1),TheCode
  684.         move.l    im_IAddress(a1),TheGadget
  685.         JSRLIB    GT_ReplyIMsg
  686.  
  687. ; Klasse auswerten
  688.         move.l    TheClass,d0
  689.         and.l    #IDCMP_GADGETUP,d0
  690.         beq    NotGadget
  691.  
  692. ; GadgetUp
  693.         move.l    TheGadget,a0
  694.  
  695. ; OK
  696.         cmp.w    #GD_OK,gg_GadgetID(a0)
  697.         bne    1$
  698.         moveq    #-1,d7
  699.         bra    PrefsDone
  700.  
  701. ; Cancel
  702. 1$        cmp.w    #GD_Cancel,gg_GadgetID(a0)
  703.         bne    2$
  704.         moveq    #0,d7
  705.         bra    PrefsDone
  706.  
  707. ; Save
  708. 2$        cmp.w    #GD_Save,gg_GadgetID(a0)
  709.         bne    4$
  710.         bsr    SaveThePrefs
  711.         bra    GetEvent
  712.  
  713. ; Joystick1On
  714. 4$        cmp.w    #GD_Joystick1On,gg_GadgetID(a0)
  715.         bne    5$
  716.         not.w    PJoystick1On
  717.         bra    GetEvent
  718.  
  719. ; Joystick2On
  720. 5$        cmp.w    #GD_Joystick2On,gg_GadgetID(a0)
  721.         bne    6$
  722.         not.w    PJoystick2On
  723.         bra    GetEvent
  724.  
  725. ; JoystickSwap
  726. 6$        cmp.w    #GD_JoystickSwap,gg_GadgetID(a0)
  727.         bne    7$
  728.         not.w    PJoystickSwap
  729.         bra    GetEvent
  730.  
  731. ; GetDisplayID
  732. 7$        cmp.w    #GD_GetDisplayID,gg_GadgetID(a0)
  733.         bne    8$
  734.         tst.w    PrefsFromEmul        ;Nur beim Start
  735.         bne    GetEvent
  736.  
  737.         cmp.w    #4,PScreenType        ;CyberGfx?
  738.         beq    71$
  739.  
  740.         move.l    _AslBase,a6        ;Nein
  741.         move.l    ScreenRequester,a0
  742.         move.l    PDisplayID,ScreenReqID
  743.         move.w    POverscan,ScreenReqOScan+2
  744.         lea    DoScreenReqTags,a1
  745.         JSRLIB    AslRequest
  746.         tst.l    d0
  747.         beq    GetEvent
  748.  
  749.         move.l    ScreenRequester,a0
  750.         move.l    sm_DisplayID(a0),PDisplayID
  751.         move.w    sm_OverscanType(a0),POverscan
  752.         bsr    SetDisplayIDGad
  753.         bra    GetEvent
  754.  
  755. 71$        tst.l    _CyberGfxBase
  756.         bne    72$
  757.         move.l    _SysBase,a6        ;Ja
  758.         moveq    #40,d0
  759.         lea    CyberGfxName,a1
  760.         JSRLIB    OpenLibrary
  761.         move.l    d0,_CyberGfxBase
  762.         beq    GetEvent
  763.  
  764. 72$        move.l    _CyberGfxBase,a6
  765.         sub.l    a0,a0
  766.         lea    DoCyberReqTags,a1
  767.         move.l    Scr,CyberReqScreen
  768.         jsr    CModeRequest(a6)
  769.         tst.l    d0
  770.         beq    GetEvent
  771.  
  772.         move.l    d0,PDisplayID
  773.         bsr    SetDisplayIDGad
  774.         bra    GetEvent
  775.  
  776. ; ScreenType
  777. 8$        cmp.w    #GD_ScreenType,gg_GadgetID(a0)
  778.         bne    9$
  779.         tst.w    PrefsFromEmul        ;Nur beim Start
  780.         bne    GetEvent
  781.         move.w    TheCode,PScreenType
  782.         bra    GetEvent
  783.  
  784. ; Use SID Card
  785. 9$        cmp.w    #GD_UseSIDCard,gg_GadgetID(a0)
  786.         bne    10$
  787.         not.w    PUseSIDCard
  788.         bra    GetEvent
  789.  
  790. ; Drive 8 is on IEC cable
  791. 10$        cmp.w    #GD_Drv8IsIEC,gg_GadgetID(a0)
  792.         bne    11$
  793.         not.w    PDrv8IsIEC
  794.         beq    101$
  795.         lea    DisableTags,a3
  796.         bra    102$
  797. 101$        lea    EnableTags,a3
  798. 102$        lea    PrefsGadgets,a0
  799.         move.l    GDX_Dir8*4(a0),a0
  800.         move.l    PrefsWnd,a1
  801.         sub.l    a2,a2
  802.         JSRLIB    GT_SetGadgetAttrsA
  803.         bra    GetEvent
  804.  
  805. ; Drive 9 is on IEC cable
  806. 11$        cmp.w    #GD_Drv9IsIEC,gg_GadgetID(a0)
  807.         bne    12$
  808.         not.w    PDrv9IsIEC
  809.         beq    111$
  810.         lea    DisableTags,a3
  811.         bra    112$
  812. 111$        lea    EnableTags,a3
  813. 112$        lea    PrefsGadgets,a0
  814.         move.l    GDX_Dir9*4(a0),a0
  815.         move.l    PrefsWnd,a1
  816.         sub.l    a2,a2
  817.         JSRLIB    GT_SetGadgetAttrsA
  818.         bra    GetEvent
  819.  
  820. ; Drive 10 is on IEC cable
  821. 12$        cmp.w    #GD_Drv10IsIEC,gg_GadgetID(a0)
  822.         bne    13$
  823.         not.w    PDrv10IsIEC
  824.         beq    121$
  825.         lea    DisableTags,a3
  826.         bra    122$
  827. 121$        lea    EnableTags,a3
  828. 122$        lea    PrefsGadgets,a0
  829.         move.l    GDX_Dir10*4(a0),a0
  830.         move.l    PrefsWnd,a1
  831.         sub.l    a2,a2
  832.         JSRLIB    GT_SetGadgetAttrsA
  833.         bra    GetEvent
  834.  
  835. ; Drive 11 is on IEC cable
  836. 13$        cmp.w    #GD_Drv11IsIEC,gg_GadgetID(a0)
  837.         bne    14$
  838.         not.w    PDrv11IsIEC
  839.         beq    131$
  840.         lea    DisableTags,a3
  841.         bra    132$
  842. 131$        lea    EnableTags,a3
  843. 132$        lea    PrefsGadgets,a0
  844.         move.l    GDX_Dir11*4(a0),a0
  845.         move.l    PrefsWnd,a1
  846.         sub.l    a2,a2
  847.         JSRLIB    GT_SetGadgetAttrsA
  848.         bra    GetEvent
  849.  
  850. ; Get Directory for drive 8
  851. 14$        cmp.w    #GD_GetDir8,gg_GadgetID(a0)
  852.         bne    15$
  853.         lea    SetDir8Tags,a3
  854.         lea    PDir8,a4
  855.         move.l    #GD_Dir8,d4
  856.         bsr    DoGetDirName
  857.         bra    GetEvent
  858.  
  859. ; Get Directory for drive 9
  860. 15$        cmp.w    #GD_GetDir9,gg_GadgetID(a0)
  861.         bne    16$
  862.         lea    SetDir9Tags,a3
  863.         lea    PDir9,a4
  864.         move.l    #GD_Dir9,d4
  865.         bsr    DoGetDirName
  866.         bra    GetEvent
  867.  
  868. ; Get Directory for drive 10
  869. 16$        cmp.w    #GD_GetDir10,gg_GadgetID(a0)
  870.         bne    17$
  871.         lea    SetDir10Tags,a3
  872.         lea    PDir10,a4
  873.         move.l    #GD_Dir10,d4
  874.         bsr    DoGetDirName
  875.         bra    GetEvent
  876.  
  877. ; Get Directory for drive 11
  878. 17$        cmp.w    #GD_GetDir11,gg_GadgetID(a0)
  879.         bne    18$
  880.         lea    SetDir11Tags,a3
  881.         lea    PDir11,a4
  882.         move.l    #GD_Dir11,d4
  883.         bsr    DoGetDirName
  884.         bra    GetEvent
  885.  
  886. ; Use IEC cable for device numbers 4-15
  887. 18$        cmp.w    #GD_OtherIEC,gg_GadgetID(a0)
  888.         bne    19$
  889.         not.w    POtherIEC
  890.         bra    GetEvent
  891.  
  892. ; American keyboard layout
  893. 19$        cmp.w    #GD_KeyboardYZ,gg_GadgetID(a0)
  894.         bne    20$
  895.         not.w    PKeyboardYZ
  896.         bra    GetEvent
  897.  
  898. ; Enable sprite collisions
  899. 20$        cmp.w    #GD_Collisions,gg_GadgetID(a0)
  900.         bne    21$
  901.         not.w    PCollisions
  902.         bra    GetEvent
  903.  
  904. ; Map '/' character in file names to '\'
  905. 21$        cmp.w    #GD_MapSlash,gg_GadgetID(a0)
  906.         bne    22$
  907.         not.w    PMapSlash
  908.         bra    GetEvent
  909.  
  910. ; Skip memory test on reset
  911. 22$        cmp.w    #GD_FastReset,gg_GadgetID(a0)
  912.         bne    23$
  913.         not.w    PFastReset
  914.         bra    GetEvent
  915.  
  916. 23$        bra    GetEvent
  917.  
  918. ; Refresh
  919. NotGadget    move.l    TheClass,d0
  920.         and.l    #IDCMP_REFRESHWINDOW,d0
  921.         beq    NotRefresh
  922.         move.l    PrefsWnd,a0
  923.         JSRLIB    GT_BeginRefresh
  924.         move.l    PrefsWnd,a0
  925.         moveq    #-1,d0
  926.         JSRLIB    GT_EndRefresh
  927.         bra    GetEvent
  928.  
  929. ; Tastatur
  930. NotRefresh    move.l    TheClass,d0
  931.         and.l    #IDCMP_VANILLAKEY,d0
  932.         beq    GetEvent
  933.  
  934.         cmp.w    #'o',TheCode        ;O - OK
  935.         bne    1$
  936.         moveq    #-1,d7
  937.         bra    PrefsDone
  938.  
  939. 1$        cmp.w    #'s',TheCode        ;S - Save
  940.         bne    2$
  941.         bsr    SaveThePrefs
  942.         bra    GetEvent
  943.  
  944. 2$        cmp.w    #'c',TheCode        ;C - Cancel
  945.         bne    3$
  946.         moveq    #0,d7
  947.         bra    PrefsDone
  948.  
  949. 3$        bra    GetEvent
  950.  
  951. ; Fertig mit den Prefs
  952. PrefsDone    bsr    GetGadgets
  953.         jsr    ClosePrefsWindow
  954. PrefsError    jsr    CloseDownScreen
  955.         rts
  956.  
  957. *
  958. * Auswahl eines Verzeichnisses
  959. * a3: Zeiger auf Tags zum Ändern des zugehörigen Stringgadgets
  960. * a4: Zeiger auf Puffer für Namen (256 Bytes)
  961. * d4: ID des Stringgadgets, das anschließend geändert werden soll
  962. *
  963.  
  964. DoGetDirName    move.l    a4,a0            ;Verzeichnisname kopieren
  965.         lea    DirName,a1
  966.         moveq    #256/4-1,d0
  967. 1$        move.l    (a0)+,(a1)+
  968.         dbra    d0,1$
  969.  
  970.         move.l    _AslBase,a6        ;Requester darstellen
  971.         move.l    DirRequester,a0
  972.         lea    DoDirReqTags,a1
  973.         JSRLIB    AslRequest
  974.         tst.l    d0
  975.         beq    3$
  976.  
  977.         move.l    DirRequester,a0        ;OK geklickt, Name zurückkopieren
  978.         move.l    fr_Drawer(a0),a0
  979.         move.l    a4,a1
  980.         moveq    #256/4-1,d0
  981. 2$        move.l    (a0)+,(a1)+
  982.         dbra    d0,2$
  983.  
  984.         move.l    _GadToolsBase,a6    ;Name-Gadget neu setzen
  985.         lea    PrefsGadgets,a0
  986.         move.l    (a0,d4.w*4),a0
  987.         move.l    PrefsWnd,a1
  988.         sub.l    a2,a2            ;a3 enthält bereits den Zeiger auf die Tags
  989.         JSRLIB    GT_SetGadgetAttrsA
  990.  
  991. 3$        rts
  992.  
  993. *
  994. * Gadgets setzen
  995. *
  996.  
  997. SetCheckGad    MACRO    ;Name
  998.         tst.w    P\1
  999.         beq    \@1$
  1000.         move.l    GDX_\1*4(a5),a0
  1001.         move.l    PrefsWnd,a1
  1002.         sub.l    a2,a2
  1003.         lea    SetCheckTags,a3
  1004.         JSRLIB    GT_SetGadgetAttrsA
  1005. \@1$
  1006.         ENDM
  1007.  
  1008. SetGadgets    move.l    _GadToolsBase,a6
  1009.         lea    PrefsGadgets,a5
  1010.  
  1011.         move.l    GDX_NormalCycles*4(a5),a0
  1012.         move.l    PrefsWnd,a1
  1013.         sub.l    a2,a2
  1014.         lea    SetIntegerTags,a3
  1015.         moveq    #0,d0
  1016.         move.w    PNormalCycles,d0
  1017.         move.l    d0,SetIntTagsVal
  1018.         JSRLIB    GT_SetGadgetAttrsA
  1019.  
  1020.         move.l    GDX_BadLineCycles*4(a5),a0
  1021.         move.l    PrefsWnd,a1
  1022.         sub.l    a2,a2
  1023.         lea    SetIntegerTags,a3
  1024.         moveq    #0,d0
  1025.         move.w    PBadLineCycles,d0
  1026.         move.l    d0,SetIntTagsVal
  1027.         JSRLIB    GT_SetGadgetAttrsA
  1028.  
  1029.         move.l    GDX_CIACycles*4(a5),a0
  1030.         move.l    PrefsWnd,a1
  1031.         sub.l    a2,a2
  1032.         lea    SetIntegerTags,a3
  1033.         moveq    #0,d0
  1034.         move.w    PCIACycles,d0
  1035.         move.l    d0,SetIntTagsVal
  1036.         JSRLIB    GT_SetGadgetAttrsA
  1037.  
  1038.         move.l    GDX_SkipLatch*4(a5),a0
  1039.         move.l    PrefsWnd,a1
  1040.         sub.l    a2,a2
  1041.         lea    SetIntegerTags,a3
  1042.         moveq    #0,d0
  1043.         move.w    PSkipLatch,d0
  1044.         move.l    d0,SetIntTagsVal
  1045.         JSRLIB    GT_SetGadgetAttrsA
  1046.  
  1047.         SetCheckGad    Joystick1On
  1048.         SetCheckGad    Joystick2On
  1049.         SetCheckGad    JoystickSwap
  1050.         SetCheckGad    UseSIDCard
  1051.         SetCheckGad    KeyboardYZ
  1052.         SetCheckGad    Collisions
  1053.         SetCheckGad    FastReset
  1054.         SetCheckGad    Drv8IsIEC
  1055.         SetCheckGad    Drv9IsIEC
  1056.         SetCheckGad    Drv10IsIEC
  1057.         SetCheckGad    Drv11IsIEC
  1058.         SetCheckGad    OtherIEC
  1059.         SetCheckGad    MapSlash
  1060.  
  1061.         tst.w    PDrv8IsIEC
  1062.         beq    6$
  1063.         move.l    GDX_Dir8*4(a5),a0
  1064.         move.l    PrefsWnd,a1
  1065.         sub.l    a2,a2
  1066.         lea    DisableTags,a3
  1067.         JSRLIB    GT_SetGadgetAttrsA
  1068.  
  1069. 6$        tst.w    PDrv9IsIEC
  1070.         beq    7$
  1071.         move.l    GDX_Dir9*4(a5),a0
  1072.         move.l    PrefsWnd,a1
  1073.         sub.l    a2,a2
  1074.         lea    DisableTags,a3
  1075.         JSRLIB    GT_SetGadgetAttrsA
  1076.  
  1077. 7$        tst.w    PDrv10IsIEC
  1078.         beq    8$
  1079.         move.l    GDX_Dir10*4(a5),a0
  1080.         move.l    PrefsWnd,a1
  1081.         sub.l    a2,a2
  1082.         lea    DisableTags,a3
  1083.         JSRLIB    GT_SetGadgetAttrsA
  1084.  
  1085. 8$        tst.w    PDrv11IsIEC
  1086.         beq    9$
  1087.         move.l    GDX_Dir11*4(a5),a0
  1088.         move.l    PrefsWnd,a1
  1089.         sub.l    a2,a2
  1090.         lea    DisableTags,a3
  1091.         JSRLIB    GT_SetGadgetAttrsA
  1092.  
  1093. 9$        move.l    GDX_ScreenType*4(a5),a0
  1094.         move.l    PrefsWnd,a1
  1095.         sub.l    a2,a2
  1096.         lea    SetCycleTags,a3
  1097.         moveq    #0,d0
  1098.         move.w    PScreenType,d0
  1099.         move.l    d0,SetCycTagsVal
  1100.         JSRLIB    GT_SetGadgetAttrsA
  1101.  
  1102.         move.l    GDX_Dir8*4(a5),a0
  1103.         move.l    PrefsWnd,a1
  1104.         sub.l    a2,a2
  1105.         lea    SetDir8Tags,a3
  1106.         JSRLIB    GT_SetGadgetAttrsA
  1107.  
  1108.         move.l    GDX_Dir9*4(a5),a0
  1109.         move.l    PrefsWnd,a1
  1110.         sub.l    a2,a2
  1111.         lea    SetDir9Tags,a3
  1112.         JSRLIB    GT_SetGadgetAttrsA
  1113.  
  1114.         move.l    GDX_Dir10*4(a5),a0
  1115.         move.l    PrefsWnd,a1
  1116.         sub.l    a2,a2
  1117.         lea    SetDir10Tags,a3
  1118.         JSRLIB    GT_SetGadgetAttrsA
  1119.  
  1120.         move.l    GDX_Dir11*4(a5),a0
  1121.         move.l    PrefsWnd,a1
  1122.         sub.l    a2,a2
  1123.         lea    SetDir11Tags,a3
  1124.         JSRLIB    GT_SetGadgetAttrsA
  1125.  
  1126.         tst.w    PrefsFromEmul        ;Vom Emulator aufgerufen:
  1127.         beq    1$            ; Bildschirmtyp und -modus
  1128.         move.l    GDX_GetDisplayID*4(a5),a0 ; ausschalten
  1129.         move.l    PrefsWnd,a1
  1130.         sub.l    a2,a2
  1131.         lea    DisableTags,a3
  1132.         JSRLIB    GT_SetGadgetAttrsA
  1133.  
  1134.         move.l    GDX_ScreenType*4(a5),a0
  1135.         move.l    PrefsWnd,a1
  1136.         sub.l    a2,a2
  1137.         lea    DisableTags,a3
  1138.         JSRLIB    GT_SetGadgetAttrsA
  1139.  
  1140. 1$        bra    SetDisplayIDGad
  1141.  
  1142. *
  1143. * DisplayID-Gadget setzen
  1144. *
  1145.  
  1146. SetDisplayIDGad move.l    _GfxBase,a6        ;DisplayID
  1147.         sub.l    a0,a0
  1148.         lea    ModeNameBuf,a1
  1149.         moveq    #nif_SIZEOF,d0
  1150.         move.l    #DTAG_NAME,d1
  1151.         move.l    PDisplayID,d2
  1152.         JSRLIB    GetDisplayInfoData
  1153.         move.l    _GadToolsBase,a6
  1154.         lea    PrefsGadgets,a0
  1155.         move.l    GDX_DisplayID*4(a0),a0
  1156.         move.l    PrefsWnd,a1
  1157.         sub.l    a2,a2
  1158.         lea    SetDIDTags,a3
  1159.         JMPLIB    GT_SetGadgetAttrsA
  1160.  
  1161. *
  1162. * Gadgets holen
  1163. *
  1164.  
  1165. GetGadgets    lea    PrefsGadgets,a1
  1166.         move.l    GDX_NormalCycles*4(a1),a0
  1167.         GetInt    d0
  1168.         move.w    d0,PNormalCycles
  1169.  
  1170.         move.l    GDX_BadLineCycles*4(a1),a0
  1171.         GetInt    d0
  1172.         move.w    d0,PBadLineCycles
  1173.  
  1174.         move.l    GDX_CIACycles*4(a1),a0
  1175.         GetInt    d0
  1176.         move.w    d0,PCIACycles
  1177.  
  1178.         move.l    GDX_SkipLatch*4(a1),a0
  1179.         GetInt    d0
  1180.         move.w    d0,PSkipLatch
  1181.  
  1182.         move.l    GDX_Dir8*4(a1),a0
  1183.         move.l    gg_SpecialInfo(a0),a0
  1184.         move.l    si_Buffer(a0),a0
  1185.         lea    PDir8,a2
  1186.         moveq    #256/4-1,d0
  1187. 11$        move.l    (a0)+,(a2)+
  1188.         dbra    d0,11$
  1189.  
  1190.         move.l    GDX_Dir9*4(a1),a0
  1191.         move.l    gg_SpecialInfo(a0),a0
  1192.         move.l    si_Buffer(a0),a0
  1193.         lea    PDir9,a2
  1194.         moveq    #256/4-1,d0
  1195. 12$        move.l    (a0)+,(a2)+
  1196.         dbra    d0,12$
  1197.  
  1198.         move.l    GDX_Dir10*4(a1),a0
  1199.         move.l    gg_SpecialInfo(a0),a0
  1200.         move.l    si_Buffer(a0),a0
  1201.         lea    PDir10,a2
  1202.         moveq    #256/4-1,d0
  1203. 13$        move.l    (a0)+,(a2)+
  1204.         dbra    d0,13$
  1205.  
  1206.         move.l    GDX_Dir11*4(a1),a0
  1207.         move.l    gg_SpecialInfo(a0),a0
  1208.         move.l    si_Buffer(a0),a0
  1209.         lea    PDir11,a2
  1210.         moveq    #256/4-1,d0
  1211. 14$        move.l    (a0)+,(a2)+
  1212.         dbra    d0,14$
  1213.         rts
  1214.  
  1215. *
  1216. * Einstellungen setzen
  1217. *
  1218.  
  1219. SetPrefs    move.w    PNormalCycles,NormalCycles
  1220.         move.w    PBadLineCycles,BadLineCycles
  1221.         move.w    PCIACycles,CIACycles
  1222.         move.w    PJoystick1On,Joystick1On
  1223.         move.w    PJoystick2On,Joystick2On
  1224.         move.w    PJoystickSwap,JoystickSwap
  1225.         move.w    PDrv8IsIEC,Drv8IsIEC
  1226.         move.w    PDrv9IsIEC,Drv9IsIEC
  1227.         move.w    PDrv10IsIEC,Drv10IsIEC
  1228.         move.w    PDrv11IsIEC,Drv11IsIEC
  1229.         move.w    POtherIEC,OtherIEC
  1230.         move.w    PCollisions,Collisions
  1231.         move.w    POverscan,Overscan
  1232.         move.w    PMapSlash,MapSlash
  1233.         move.w    PFastReset,FastReset
  1234.  
  1235.         move.w    PSkipLatch,SkipLatch
  1236.         bne    2$
  1237.         move.w    #1,SkipLatch        ;Keine Null zulassen
  1238. 2$
  1239.         tst.w    PrefsFromEmul
  1240.         bne    1$
  1241.         move.l    PDisplayID,DisplayID    ;Nur beim Start
  1242.         move.w    PScreenType,ScreenType
  1243. 1$
  1244.         lea    PDir8,a0
  1245.         lea    Dir8,a1
  1246.         moveq    #256/4-1,d0
  1247. 11$        move.l    (a0)+,(a1)+
  1248.         dbra    d0,11$
  1249.  
  1250.         lea    PDir9,a0
  1251.         lea    Dir9,a1
  1252.         moveq    #256/4-1,d0
  1253. 12$        move.l    (a0)+,(a1)+
  1254.         dbra    d0,12$
  1255.  
  1256.         lea    PDir10,a0
  1257.         lea    Dir10,a1
  1258.         moveq    #256/4-1,d0
  1259. 13$        move.l    (a0)+,(a1)+
  1260.         dbra    d0,13$
  1261.  
  1262.         lea    PDir11,a0
  1263.         lea    Dir11,a1
  1264.         moveq    #256/4-1,d0
  1265. 14$        move.l    (a0)+,(a1)+
  1266.         dbra    d0,14$
  1267.  
  1268.         move.w    PUseSIDCard,UseSIDCard
  1269.         jsr    ChangedSID
  1270.  
  1271.         move.w    PKeyboardYZ,KeyboardYZ
  1272.         jmp    ChangedKeys
  1273.  
  1274. *
  1275. * Einstellungen holen
  1276. *
  1277.  
  1278. GetPrefs    move.w    NormalCycles,PNormalCycles
  1279.         move.w    BadLineCycles,PBadLineCycles
  1280.         move.w    CIACycles,PCIACycles
  1281.         move.w    Joystick1On,PJoystick1On
  1282.         move.w    Joystick2On,PJoystick2On
  1283.         move.w    JoystickSwap,PJoystickSwap
  1284.         move.w    UseSIDCard,PUseSIDCard
  1285.         move.w    Drv8IsIEC,PDrv8IsIEC
  1286.         move.w    Drv9IsIEC,PDrv9IsIEC
  1287.         move.w    Drv10IsIEC,PDrv10IsIEC
  1288.         move.w    Drv11IsIEC,PDrv11IsIEC
  1289.         move.w    OtherIEC,POtherIEC
  1290.         move.w    KeyboardYZ,PKeyboardYZ
  1291.         move.w    Collisions,PCollisions
  1292.         move.w    Overscan,POverscan
  1293.         move.w    MapSlash,PMapSlash
  1294.         move.w    FastReset,PFastReset
  1295.         move.l    DisplayID,PDisplayID
  1296.         move.w    ScreenType,PScreenType
  1297.         move.w    SkipLatch,PSkipLatch
  1298.  
  1299.         lea    Dir8,a0
  1300.         lea    PDir8,a1
  1301.         moveq    #256/4-1,d0
  1302. 11$        move.l    (a0)+,(a1)+
  1303.         dbra    d0,11$
  1304.  
  1305.         lea    Dir9,a0
  1306.         lea    PDir9,a1
  1307.         moveq    #256/4-1,d0
  1308. 12$        move.l    (a0)+,(a1)+
  1309.         dbra    d0,12$
  1310.  
  1311.         lea    Dir10,a0
  1312.         lea    PDir10,a1
  1313.         moveq    #256/4-1,d0
  1314. 13$        move.l    (a0)+,(a1)+
  1315.         dbra    d0,13$
  1316.  
  1317.         lea    Dir11,a0
  1318.         lea    PDir11,a1
  1319.         moveq    #256/4-1,d0
  1320. 14$        move.l    (a0)+,(a1)+
  1321.         dbra    d0,14$
  1322.         rts
  1323.  
  1324. *
  1325. * Einstellungen speichern
  1326. *
  1327.  
  1328. SaveThePrefs    bsr    GetGadgets
  1329.  
  1330.         move.l    _DOSBase,a6        ;Datei öffnen
  1331.         move.l    #PrefsFileName,d1
  1332.         move.l    #MODE_NEWFILE,d2
  1333.         JSRLIB    Open
  1334.         move.l    d0,d6
  1335.         beq    2$
  1336.  
  1337.         move.l    d6,d1            ;Einstellungen schreiben
  1338.         move.l    #ThePrefs,d2
  1339.         move.l    #PrefsLength,d3
  1340.         JSRLIB    Write
  1341.  
  1342.         move.l    d6,d1            ;Datei schließene
  1343.         JSRLIB    Close
  1344.  
  1345.         move.l    _IconBase,a6        ;Icon bereits vorhanden?
  1346.         lea    PrefsFileName,a0
  1347.         JSRLIB    GetDiskObject
  1348.         tst.l    d0
  1349.         beq    1$
  1350.         move.l    d0,a0            ;Ja, dann nichts machen
  1351.         JSRLIB    FreeDiskObject
  1352.         rts
  1353.  
  1354. 1$        lea    PrefsFileName,a0    ;Nein, Icon erzeugen
  1355.         lea    PrefsIcon,a1
  1356.         JSRLIB    PutDiskObject
  1357. 2$        rts
  1358.  
  1359. *
  1360. * Requester entsprechend dem Rückgabewert von ChangedIEC anzeigen
  1361. * d0: Rückgabewert
  1362. *
  1363.  
  1364. IECErrorReq    tst.l    d0
  1365.         beq    1$
  1366.         cmp.l    #1,d0
  1367.         bne    2$
  1368.         lea    NoParPortReq,a1
  1369.         bra    3$
  1370. 2$        lea    NoTimerReq,a1
  1371. 3$        move.l    a6,-(sp)
  1372.         move.l    _IntuitionBase,a6
  1373.         sub.l    a0,a0
  1374.         move.l    a0,a2
  1375.         move.l    a0,a3
  1376.         JSRLIB    EasyRequestArgs
  1377.         move.l    (sp)+,a6
  1378. 1$        rts
  1379.  
  1380.  
  1381. *
  1382. * Zufallsbyte ermitteln (0..255)
  1383. * d0: Ergebnis als 32-Bit-Wert (MSW muß Null sein!)
  1384. *
  1385.  
  1386. Random        move.l    RandomSeed,d1
  1387.         mulu.l    #2311,d1
  1388.         add.l    #25367,d1
  1389.         divul.l    #120050,d0:d1    ;Rest nach d0
  1390.         move.l    d0,RandomSeed
  1391.         lsl.l    #8,d0
  1392.         divu.l    #120050,d0
  1393.         rts
  1394.  
  1395.  
  1396. *
  1397. * Strings in Datenstrukturen lokalisieren
  1398. *
  1399.  
  1400. GetStr        MACRO    ;Label
  1401.         lea    TheLocale,a0
  1402.         move.l    #\1,d0
  1403.         jsr    GetString
  1404.         ENDM
  1405.  
  1406. Localize    move.l    _UtilityBase,a6
  1407.  
  1408.         GetStr    MSG_REQTITLE
  1409.         move.l    d0,ErrorReq+es_Title
  1410.         move.l    d0,NoParPortReq+es_Title
  1411.         move.l    d0,NoTimerReq+es_Title
  1412.  
  1413.         GetStr    MSG_SCREENTITLE
  1414.         move.l    d0,d2
  1415.         lea    PrefsWindowTags,a0
  1416.         move.l    #WA_ScreenTitle,d0
  1417.         JSRLIB    FindTagItem
  1418.         move.l    d0,a0
  1419.         move.l    d2,4(a0)
  1420.  
  1421.         GetStr    MSG_PREFSTITLE
  1422.         move.l    d0,d2
  1423.         lea    PrefsWindowTags,a0
  1424.         move.l    #WA_Title,d0
  1425.         JSRLIB    FindTagItem
  1426.         move.l    d0,a0
  1427.         move.l    d2,4(a0)
  1428.  
  1429.         GetStr    MSG_REQGADS
  1430.         move.l    d0,ErrorReq+es_GadgetFormat
  1431.  
  1432.         GetStr    MSG_REQGADS2
  1433.         move.l    d0,NoParPortReq+es_GadgetFormat
  1434.         move.l    d0,NoTimerReq+es_GadgetFormat
  1435.  
  1436.         GetStr    MSG_NOPARPORT
  1437.         move.l    d0,NoParPortReq+es_TextFormat
  1438.  
  1439.         GetStr    MSG_NOTIMER
  1440.         move.l    d0,NoTimerReq+es_TextFormat
  1441.  
  1442.         GetStr    MSG_SCREENHAIL
  1443.         move.l    d0,ScreenHailText
  1444.         move.l    d0,CyberHailText
  1445.  
  1446.         GetStr    MSG_DIRHAIL
  1447.         move.l    d0,DirHailText
  1448.  
  1449.         lea    GadTransTable,a2
  1450.         lea    PrefsNGads,a3
  1451. 1$        lea    TheLocale,a0
  1452.         move.l    (a2)+,d0
  1453.         beq    2$
  1454.         jsr    GetString
  1455.         move.l    (a2)+,d1
  1456.         mulu.l    #gng_SIZEOF,d1
  1457.         move.l    d0,gng_GadgetText(a3,d1.w)
  1458.         bra    1$
  1459. 2$        rts
  1460.  
  1461. GadTransTable    dc.l    MSG_OK_GAD,GDX_OK
  1462.         dc.l    MSG_SAVE_GAD,GDX_Save
  1463.         dc.l    MSG_CANCEL_GAD,GDX_Cancel
  1464.         dc.l    MSG_JOYSTICK1ON_GAD,GDX_Joystick1On
  1465.         dc.l    MSG_JOYSTICK2ON_GAD,GDX_Joystick2On
  1466.         dc.l    MSG_JOYSTICKSWAP_GAD,GDX_JoystickSwap
  1467.         dc.l    MSG_GETDISPLAYID_GAD,GDX_GetDisplayID
  1468.         dc.l    MSG_DISPLAYID_GAD,GDX_DisplayID
  1469.         dc.l    MSG_SCREENTYPE_GAD,GDX_ScreenType
  1470.         dc.l    MSG_NORMALCYCLES_GAD,GDX_NormalCycles
  1471.         dc.l    MSG_BADLINECYCLES_GAD,GDX_BadLineCycles
  1472.         dc.l    MSG_CIACYCLES_GAD,GDX_CIACycles
  1473.         dc.l    MSG_DIR8_GAD,GDX_Dir8
  1474.         dc.l    MSG_DIR9_GAD,GDX_Dir9
  1475.         dc.l    MSG_DIR10_GAD,GDX_Dir10
  1476.         dc.l    MSG_DIR11_GAD,GDX_Dir11
  1477.         dc.l    MSG_USESIDCARD_GAD,GDX_UseSIDCard
  1478.         dc.l    MSG_OTHERIEC_GAD,GDX_OtherIEC
  1479.         dc.l    MSG_KEYBOARDYZ_GAD,GDX_KeyboardYZ
  1480.         dc.l    MSG_COLLISIONS_GAD,GDX_Collisions
  1481.         dc.l    MSG_MAPSLASH_GAD,GDX_MapSlash
  1482.         dc.l    MSG_FASTRESET_GAD,GDX_FastReset
  1483.         dc.l    MSG_SKIPLATCH_GAD,GDX_SkipLatch
  1484.         dc.l    0,0
  1485.  
  1486.  
  1487. **
  1488. ** Konstanten
  1489. **
  1490.  
  1491. ; Strings
  1492. Version        VERSTAG
  1493. UtilityName    dc.b    "utility.library",0
  1494. IntuiName    dc.b    "intuition.library",0
  1495. GfxName        dc.b    "graphics.library",0
  1496. GadToolsName    dc.b    "gadtools.library",0
  1497. AslName        dc.b    "asl.library",0
  1498. IconName    dc.b    "icon.library",0
  1499. LocaleName    dc.b    "locale.library",0
  1500. SID6581Name    dc.b    "6581sid.library",0
  1501. CyberGfxName    dc.b    "cybergraphics.library",0
  1502. CiaResName    dc.b    "ciaa.resource",0
  1503. MiscResName    dc.b    "misc.resource",0
  1504.  
  1505. CatalogName    dc.b    "Frodo.catalog",0
  1506. PrefsFileName    dc.b    "PROGDIR:Frodo Prefs",0
  1507. BasicFileName    dc.b    "PROGDIR:Basic ROM",0
  1508. KernalFileName    dc.b    "PROGDIR:Kernal ROM",0
  1509. CharFileName    dc.b    "PROGDIR:Char ROM",0
  1510. Template    dc.b    "TURBO=TURBOCYBER/S",0
  1511. TurboToolType    dc.b    "TURBOCYBER",0
  1512.         CNOP    0,4
  1513.  
  1514.  
  1515. **
  1516. ** Datenbereich
  1517. **
  1518.  
  1519. _UtilityBase    dc.l    0
  1520. _IntuitionBase    dc.l    0
  1521. _GfxBase    dc.l    0
  1522. _GadToolsBase    dc.l    0
  1523. _AslBase    dc.l    0
  1524. _IconBase    dc.l    0
  1525. _EGSBase    dc.l    0
  1526. _VilIntuiBase    dc.l    0
  1527. _CyberGfxBase    dc.l    0
  1528. _HRGSystemBase    dc.l    0
  1529. _SID6581Base    dc.l    0
  1530. _CiaBase    dc.l    0
  1531. _MiscBase    dc.l    0
  1532.  
  1533. TheLocale            ;Struktur für GetString
  1534. _LocaleBase    dc.l    0
  1535. TheCatalog    dc.l    0
  1536.  
  1537. MainTask    dc.l    0    ;Emulator-Haupttask
  1538.  
  1539. TurboCyber    dc.l    0    ;Argumente (Reihenfolge ist wichtig!)
  1540.  
  1541. RandomSeed    dc.l    0    ;Basis für Zufallsgenerator
  1542.  
  1543. ScreenRequester    dc.l    0    ;ScreenMode-Requester
  1544. DirRequester    dc.l    0    ;Directory-Requester
  1545.  
  1546. RAMBlock    dc.l    0    ;Zeiger auf Speicherbereich
  1547.  
  1548. TheClass    dc.l    0    ;Für Preferences
  1549. TheGadget    dc.l    0
  1550. TheCode        dc.w    0
  1551.  
  1552. PrefsFromEmul    dc.w    0    ;#0: Einstellungen vom Emulator aus aufgerufen
  1553.  
  1554. ; Prefs-Icon
  1555. PrefsIcon    dc.w    WB_DISKMAGIC,WB_DISKVERSION
  1556.         dc.l    0
  1557.         dc.w    0,0,54,23
  1558.         dc.w    4,1,1
  1559.         dc.l    PrefsI1,0,0,0,0
  1560.         dc.w    0
  1561.         dc.l    1
  1562.         dc.b    WBPROJECT,0
  1563.         dc.l    0,0
  1564.         dc.l    NO_ICON_POSITION,NO_ICON_POSITION
  1565.         dc.l    0,0,0
  1566.  
  1567. ; Image für Prefs-Icon
  1568. PrefsI1        dc.w    0,0,54,22,8
  1569.         dc.l    PrefsI1Data
  1570.         dc.b    255,0
  1571.         dc.l    0
  1572.  
  1573. ; Requester
  1574. ErrorReq    dc.l    20,0,0,0,0
  1575. NoParPortReq    dc.l    20,0,0,0,0
  1576. NoTimerReq    dc.l    20,0,0,0,0
  1577.  
  1578. ; Tags zum Setzen von Gadgets
  1579. SetDir8Tags    dc.l    GTST_String,PDir8
  1580.         dc.l    0,0
  1581. SetDir9Tags    dc.l    GTST_String,PDir9
  1582.         dc.l    0,0
  1583. SetDir10Tags    dc.l    GTST_String,PDir10
  1584.         dc.l    0,0
  1585. SetDir11Tags    dc.l    GTST_String,PDir11
  1586.         dc.l    0,0
  1587. SetIntegerTags    dc.l    GTIN_Number
  1588. SetIntTagsVal    dc.l    0
  1589.         dc.l    0,0
  1590. SetCheckTags    dc.l    GTCB_Checked,-1
  1591.         dc.l    0,0
  1592. SetCycleTags    dc.l    GTCY_Active
  1593. SetCycTagsVal    dc.l    0
  1594.         dc.l    0,0
  1595. SetDIDTags    dc.l    GTTX_Text,ModeNameBuf+16
  1596.         dc.l    0,0
  1597. DisableTags    dc.l    GA_Disabled,-1
  1598.         dc.l    0,0
  1599. EnableTags    dc.l    GA_Disabled,0
  1600.         dc.l    0,0
  1601.  
  1602. ; Tags für ScreenMode-Requester
  1603. ScreenReqTags    dc.l    ASLSM_TitleText
  1604. ScreenHailText    dc.l    0
  1605.         dc.l    ASLSM_SleepWindow,-1
  1606.         dc.l    ASLSM_DoOverscanType,-1
  1607.         dc.l    ASLSM_PropertyMask,DIPF_IS_HAM|DIPF_IS_EXTRAHALFBRITE|DIPF_IS_DUALPF
  1608.         dc.l    ASLSM_PropertyFlags,0
  1609.         dc.l    0,0
  1610.  
  1611. DoScreenReqTags    dc.l    ASLSM_InitialDisplayID
  1612. ScreenReqID    dc.l    0
  1613.         dc.l    ASLSM_InitialOverscanType
  1614. ScreenReqOScan    dc.l    0
  1615.         dc.l    ASLSM_Window
  1616. ScreenReqWindow    dc.l    0
  1617.         dc.l    0,0
  1618.  
  1619. DoCyberReqTags    dc.l    CYBRMREQ_Screen
  1620. CyberReqScreen    dc.l    0
  1621.         dc.l    CYBRMREQ_WinTitle
  1622. CyberHailText    dc.l    0
  1623.         dc.l    CYBRMREQ_MinWidth,384
  1624.         dc.l    CYBRMREQ_MinHeight,272
  1625.         dc.l    CYBRMREQ_MaxDepth,8
  1626.         dc.l    0,0
  1627.  
  1628. ; Tags für den Directory-Requester
  1629. DirReqTags    dc.l    ASLFR_TitleText
  1630. DirHailText    dc.l    0
  1631.         dc.l    ASLFR_SleepWindow,-1
  1632.         dc.l    ASLFR_Flags2,FRF_REJECTICONS|FRF_DRAWERSONLY
  1633.         dc.l    0,0
  1634.  
  1635. DoDirReqTags    dc.l    ASLFR_InitialDrawer,DirName
  1636.         dc.l    ASLFR_Window
  1637. DirReqWindow    dc.l    0
  1638.         dc.l    0,0
  1639.  
  1640.  
  1641. **
  1642. ** Icon-Daten
  1643. **
  1644.  
  1645.         SECTION    "CHIPDATA",DATA,CHIP
  1646.  
  1647. PrefsI1Data    dc.w    $0000,$0000,$0000,$0400,$0000,$0000,$0000,$0C00
  1648.         dc.w    $0003,$FFC0,$0000,$0C00,$000C,$0030,$0000,$0C00
  1649.         dc.w    $0010,$7E08,$0000,$0C00,$0020,$8104,$0000,$0C00
  1650.         dc.w    $0020,$4104,$0000,$0C00,$0020,$4104,$0000,$0C00
  1651.         dc.w    $0010,$8204,$0000,$0C00,$000F,$0C08,$0000,$0C00
  1652.         dc.w    $0000,$3010,$0000,$0C00,$0000,$4060,$0000,$0C00
  1653.         dc.w    $0000,$8180,$0000,$0C00,$0001,$0E00,$0000,$0C00
  1654.         dc.w    $0000,$8400,$0000,$0C00,$0000,$7800,$0000,$0C00
  1655.         dc.w    $0000,$8400,$0000,$0C00,$0000,$8400,$0000,$0C00
  1656.         dc.w    $0000,$7800,$0000,$0C00,$0000,$0000,$0000,$0C00
  1657.         dc.w    $0000,$0000,$0000,$0C00,$7FFF,$FFFF,$FFFF,$FC00
  1658.  
  1659.         dc.w    $FFFF,$FFFF,$FFFF,$F800,$D555,$5557,$D555,$5000
  1660.         dc.w    $D554,$001F,$F555,$5000,$D553,$FFCF,$F555,$5000
  1661.         dc.w    $D54F,$81F7,$F555,$5000,$D55F,$54FB,$F555,$5000
  1662.         dc.w    $D55F,$94FB,$FFD5,$5000,$D55F,$94F9,$7FF5,$5000
  1663.         dc.w    $D54F,$55F9,$7FD5,$5000,$D550,$53F5,$7FD5,$5000
  1664.         dc.w    $D555,$4FE5,$5F55,$5000,$D555,$3F95,$60D5,$5000
  1665.         dc.w    $D555,$7E7D,$6055,$5000,$D554,$F1FD,$6035,$5000
  1666.         dc.w    $D555,$79FF,$FFD5,$5000,$D555,$05FF,$F555,$5000
  1667.         dc.w    $D555,$797F,$F555,$5000,$D555,$797F,$F555,$5000
  1668.         dc.w    $D555,$055F,$F555,$5000,$D555,$5557,$D555,$5000
  1669.         dc.w    $D555,$5555,$5555,$5000,$8000,$0000,$0000,$0000
  1670.  
  1671.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1672.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1673.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1674.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1675.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1676.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1677.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1678.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1679.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1680.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1681.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1682.  
  1683.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1684.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1685.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1686.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1687.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1688.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1689.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1690.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1691.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1692.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1693.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1694.  
  1695.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1696.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1697.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1698.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1699.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1700.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1701.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1702.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1703.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1704.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1705.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1706.  
  1707.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1708.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1709.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1710.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1711.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1712.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1713.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1714.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1715.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1716.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1717.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1718.  
  1719.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1720.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1721.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1722.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1723.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1724.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1725.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1726.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1727.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1728.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1729.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1730.  
  1731.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1732.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1733.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1734.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1735.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1736.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1737.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1738.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1739.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1740.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1741.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1742.  
  1743.  
  1744. **
  1745. ** Nicht initialisierte Daten
  1746. **
  1747.  
  1748.         SECTION    "BSS",BSS
  1749. ModeNameBuf    ds.b    nif_SIZEOF    ;Puffer für GetDisplayInfoData
  1750. DirName        ds.b    256        ;Puffer für Directory-Requester
  1751.  
  1752. ; Einstellungen
  1753. ThePrefs
  1754. Pdummy        ds.w    1
  1755. PNormalCycles    ds.w    1
  1756. PBadLineCycles    ds.w    1
  1757. PCIACycles    ds.w    1
  1758. PJoystick1On    ds.w    1
  1759. PJoystick2On    ds.w    1
  1760. PJoystickSwap    ds.w    1
  1761. PDisplayID    ds.l    1
  1762. PScreenType    ds.w    1
  1763. PDir8        ds.b    256
  1764. PDir9        ds.b    256
  1765. PDir10        ds.b    256
  1766. PDir11        ds.b    256
  1767. PDrv8IsIEC    ds.w    1
  1768. PDrv9IsIEC    ds.w    1
  1769. PDrv10IsIEC    ds.w    1
  1770. PDrv11IsIEC    ds.w    1
  1771. PUseSIDCard    ds.w    1
  1772. POtherIEC    ds.w    1
  1773. PKeyboardYZ    ds.w    1
  1774. PCollisions    ds.w    1
  1775. POverscan    ds.w    1
  1776. PMapSlash    ds.w    1
  1777. PFastReset    ds.w    1
  1778. PSkipLatch    ds.w    1
  1779. PrefsLength    = *-ThePrefs
  1780.  
  1781. FastReset    ds.w    1    ;Prefs: Speichertest bei Reset abschalten
  1782.  
  1783.         END
  1784.